return {
  "nvim-tree/nvim-tree.lua",
  dependencies = "nvim-tree/nvim-web-devicons",
  config = function()
    local nvimtree = require("nvim-tree")

    -- recommended settings from nvim-tree documentation
    vim.g.loaded_netrw = 1
    vim.g.loaded_netrwPlugin = 1
    local function my_on_attach(bufnr)
      -- bufnr 是 nvim-tree 窗口的缓冲区 ID
      local api = require "nvim-tree.api"
      -- 创建一个局部函数来简化按键绑定选项
      local function opts(desc)
        return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
      end
      -- 2. 在这里为 nvim-tree 窗口设置专属快捷键
      --    因为指定了 `buffer = bufnr`，所以这些快捷键只在这个缓冲区生效
      -- 使用 h 和 l 来代替回车键
      --
      api.config.mappings.default_on_attach(bufnr)
      vim.keymap.set('n', 'l', api.node.open.edit, opts('Open'))
      vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Close Parent'))
      
      -- 你也可以添加其他只在 nvim-tree 中使用的快捷键
      -- vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split'))
      -- vim.keymap.set('n', '<CR>', api.node.open.edit, opts('Open')) -- 这是默认的回车行为

      -- 注意：最好不要在这里加载默认按键绑定，因为它会覆盖你的设置
    end

    nvimtree.setup({
      view = {
        width = 40,
        relativenumber = true,
      },
      -- change folder arrow icons
      renderer = {
        indent_markers = {
          enable = true,
        },
     },
      -- disable window_picker for
      -- explorer to work well with
      -- window splits
      actions = {
        open_file = {
          quit_on_open = true,
          window_picker = {
            enable = false,
          },
        },
      },
      filters = {
        custom = { ".DS_Store" },
      },
      git = {
        ignore = false,
      },
      on_attach = my_on_attach,
    })

    -- set keymaps
    local keymap = vim.keymap -- for conciseness
    keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" }) -- toggle file explorer
    keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFileToggle<CR>", { desc = "Toggle file explorer on current file" }) -- toggle file explorer on current file
    keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" }) -- collapse file explorer
    keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" }) -- refresh file explorer
    --

  end,
}
